<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node217.html" />
<link rel="prev" href="module-xml.dom.html" />
<link rel="parent" href="module-xml.dom.html" />
<link rel="next" href="node217.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>8.6.1 Module Contents</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="8.6 xml.dom  "
  href="module-xml.dom.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="8.6 xml.dom  "
  href="module-xml.dom.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="8.6.2 objects in the"
  href="node217.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-xml.dom.html">8.6 xml.dom  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-xml.dom.html">8.6 xml.dom  </a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node217.html">8.6.2 Objects in the</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h2><a name="SECTION0010610000000000000000">
8.6.1 Module Contents</a>
</h2>

<p>
The <tt class="module">xml.dom</tt> contains the following functions:

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-1765' xml:id='l2h-1765' class="function">registerDOMImplementation</tt></b>(</nobr></td>
  <td><var>name, factory</var>)</td></tr></table></dt>
<dd>
Register the <var>factory</var> function with the name <var>name</var>.  The
factory function should return an object which implements the
<tt class="class">DOMImplementation</tt> interface.  The factory function can return
the same object every time, or a new one for each call, as appropriate
for the specific implementation (e.g. if that implementation supports
some customization).
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-1766' xml:id='l2h-1766' class="function">getDOMImplementation</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>name</var><big>[</big><var>, features</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a suitable DOM implementation. The <var>name</var> is either
well-known, the module name of a DOM implementation, or
<code>None</code>. If it is not <code>None</code>, imports the corresponding
module and returns a <tt class="class">DOMImplementation</tt> object if the import
succeeds.  If no name is given, and if the environment variable
<a class="envvar" id='l2h-1771' xml:id='l2h-1771'>PYTHON_DOM</a> is set, this variable is used to find the
implementation.

<p>
If name is not given, this examines the available implementations to
find one with the required feature set.  If no implementation can be
found, raise an <tt class="exception">ImportError</tt>.  The features list must be a
sequence of <code>(<var>feature</var>, <var>version</var>)</code> pairs which are
passed to the <tt class="method">hasFeature()</tt> method on available
<tt class="class">DOMImplementation</tt> objects.
</dl>

<p>
Some convenience constants are also provided:

<p>
<dl><dt><b><tt id='l2h-1767' xml:id='l2h-1767'>EMPTY_NAMESPACE</tt></b></dt>
<dd>
  The value used to indicate that no namespace is associated with a
  node in the DOM.  This is typically found as the
  <tt class="member">namespaceURI</tt> of a node, or used as the <var>namespaceURI</var>
  parameter to a namespaces-specific method.
  
<span class="versionnote">New in version 2.2.</span>

</dd></dl>

<p>
<dl><dt><b><tt id='l2h-1768' xml:id='l2h-1768'>XML_NAMESPACE</tt></b></dt>
<dd>
  The namespace URI associated with the reserved prefix <code>xml</code>, as
  defined by
  <em class="citetitle"><a
 href="http://www.w3.org/TR/REC-xml-names/"
 title="Namespaces in XML"
 >Namespaces in XML</a></em>
  (section&nbsp;4).
  
<span class="versionnote">New in version 2.2.</span>

</dd></dl>

<p>
<dl><dt><b><tt id='l2h-1769' xml:id='l2h-1769'>XMLNS_NAMESPACE</tt></b></dt>
<dd>
  The namespace URI for namespace declarations, as defined by
  <em class="citetitle"><a
 href="http://www.w3.org/TR/DOM-Level-2-Core/core.html"
 title="Document
  Object Model (DOM) Level&nbsp;2 Core Specification"
 >Document
  Object Model (DOM) Level&nbsp;2 Core Specification</a></em> (section&nbsp;1.1.8).
  
<span class="versionnote">New in version 2.2.</span>

</dd></dl>

<p>
<dl><dt><b><tt id='l2h-1770' xml:id='l2h-1770'>XHTML_NAMESPACE</tt></b></dt>
<dd>
  The URI of the XHTML namespace as defined by
  <em class="citetitle"><a
 href="http://www.w3.org/TR/xhtml1/"
 title="XHTML 1.0: The Extensible
  HyperText Markup Language"
 >XHTML 1.0: The Extensible
  HyperText Markup Language</a></em> (section&nbsp;3.1.1).
  
<span class="versionnote">New in version 2.2.</span>

</dd></dl>

<p>
In addition, <tt class="module">xml.dom</tt> contains a base <tt class="class">Node</tt> class and
the DOM exception classes.  The <tt class="class">Node</tt> class provided by this
module does not implement any of the methods or attributes defined by
the DOM specification; concrete DOM implementations must provide
those.  The <tt class="class">Node</tt> class provided as part of this module does
provide the constants used for the <tt class="member">nodeType</tt> attribute on
concrete <tt class="class">Node</tt> objects; they are located within the class
rather than at the module level to conform with the DOM
specifications.

<p>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="8.6 xml.dom  "
  href="module-xml.dom.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="8.6 xml.dom  "
  href="module-xml.dom.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="8.6.2 objects in the"
  href="node217.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-xml.dom.html">8.6 xml.dom  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-xml.dom.html">8.6 xml.dom  </a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node217.html">8.6.2 Objects in the</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
